//-----------------------------------------------------------------------
// <copyright file="KeyWordBuyService.cs" company="FetCo">
//     Copyright (c) FetCo. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------	

using System;
using System.Collections;
using FetCo.Framework;
using ADESSA.Entities;
using ADESSA.Data;
    
namespace ADESSA.Business
{   
	/// <summary>
	/// 
	/// </summary> 
    public class KeyWordBuyService
    {
        #region KeyWordBuy

        public static void CreateKeyWordBuy(KeyWordBuy keyWordBuy)
        {            
            try
            {
                KeyWordBuyDAO keyWordBuyDAO = new KeyWordBuyDAO();
                keyWordBuyDAO.CreateKeyWordBuy(keyWordBuy);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessCreateKeyWordBuyException, ex);
            }
        }        

        public static void UpdateKeyWordBuy(KeyWordBuy keyWordBuy)
        {            
            try
            {
                KeyWordBuyDAO keyWordBuyDAO = new KeyWordBuyDAO();
                keyWordBuyDAO.UpdateKeyWordBuy(keyWordBuy);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessUpdateKeyWordBuyException, ex);
            }
        }        

        public static void DeleteKeyWordBuy(long keyWordId)
        {            
            try
            {
                KeyWordBuyDAO keyWordBuyDAO = new KeyWordBuyDAO();
                keyWordBuyDAO.DeleteKeyWordBuy(keyWordId);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessDeleteKeyWordBuyException, ex);
            }
        }
        
        public static KeyWordBuy GetKeyWordBuy(long keyWordId)
        {            
            try
            {
                KeyWordBuyDAO keyWordBuyDAO = new KeyWordBuyDAO();
                return keyWordBuyDAO.GetKeyWordBuy(keyWordId);                
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetKeyWordBuyException, ex);
            }
        }                

        public static KeyWordBuyCollection GetKeyWordBuyList(KeyWordBuyColumns orderBy, OrderDirection orderDirection)
        {            
            try
            {
                KeyWordBuyDAO keyWordBuyDAO = new KeyWordBuyDAO();
                return keyWordBuyDAO.GetKeyWordBuyList(orderBy, orderDirection);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetKeyWordBuyListException, ex);
            }
        }        

        public static KeyWordBuyCollection GetKeyWordBuyList(KeyWordBuyColumns orderBy, OrderDirection orderDirection, int page, int pageSize, out int totalRecords)
        {            
            try
            {
                KeyWordBuyDAO keyWordBuyDAO = new KeyWordBuyDAO();
                return keyWordBuyDAO.GetKeyWordBuyList(orderBy, orderDirection, page, pageSize, out totalRecords);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetKeyWordBuyListException, ex);
            }
        }        

	    public static KeyWordBuyCollection GetKeyWordBuyListByParam(object orderBy, OrderDirection orderDirection,string where)
        {            
            try
            {
                KeyWordBuyDAO keyWordBuyDAO = new KeyWordBuyDAO();
                return keyWordBuyDAO.GetKeyWordBuyListByParam(orderBy, orderDirection,where);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetKeyWordBuyListException, ex);
            }
        }        

        public static KeyWordBuyCollection GetKeyWordBuyListByParam(object orderBy, OrderDirection orderDirection, int page, int pageSize,string Criteria, out int totalRecords)
        {            
            try
            {
                KeyWordBuyDAO keyWordBuyDAO = new KeyWordBuyDAO();
                return keyWordBuyDAO.GetKeyWordBuyListByParam(orderBy, orderDirection, page, pageSize,Criteria, out totalRecords);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetKeyWordBuyListException, ex);
            }
        }        

        #endregion
    }
}